/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javabean;
ahjdgfjsh
fauzan coba coba coba
budiman gak mboiz
/**
 *
 * @author aa
 */
asddasdpublic class SaleEntry {
private String itemID = "a1234";
private double discountCode = 4.0;
private int numItems = 1;
public String getItemID() {
return(itemID);
}
public void setItemID(String itemID) {
if (itemID != null) {
this.itemID = itemID;
} else {
this.itemID = "unknown";
}
}
public double getDiscountCode() {
return(discountCode);
}
public void setDiscountCode(double discountCode) {
this.discountCode = discountCode;
}
public int getNumItems() {
return(numItems);
}
public void setNumItems(int numItems) {
this.numItems = numItems;
}

public double getItemCost() {
double cost;
if (itemID.equals("a1234")) {
cost = 12.99*getDiscountCode();
} else {
cost = -9999;
}
return(cost);
}

public double getTotalCost() {
return(getItemCost() * getNumItems());
}
}
